/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.webhomesites.locacao.view;

import br.com.webhomesites.configuracao.utils.ConfiguracaoInstancias;
import br.com.webhomesites.locacao.model.ItensLocacaoTableModel;
import br.com.webhomesites.locacao.model.LocacaoTableModel;
import br.com.webhomesites.padrao.model.ClienteModel;
import java.awt.Color;
import java.awt.Component;
import java.awt.event.ActionListener;
import java.awt.event.KeyListener;
import java.awt.event.MouseListener;
import java.util.List;
import javax.swing.JTextField;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableColumnModel;

/**
 *
 * @author Webhome
 */
public class DevolucaoView extends javax.swing.JInternalFrame {

    /**
     * Creates new form DevolucaoView
     */
    public DevolucaoView() {
        initComponents();
        
        comboLocacaoTabelaLocacao.removeAllItems();
        comboLocacaoNomeCliente.removeAllItems();
        comboLocacaoNomeClienteBusca.removeAllItems();
        comboLocacaoTabelaLocacao.setEditable(false);
        
        
        
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        painelBuscarLocacao = new javax.swing.JPanel();
        btnCancelarBuscaLocacao = new javax.swing.JButton();
        txtLocacaoCodigoLocacaoBusca = new javax.swing.JTextField();
        labelLocacaoCodigoBusca = new javax.swing.JLabel();
        comboLocacaoNomeClienteBusca = new javax.swing.JComboBox();
        labelLocacaoNomeClienteBusca = new javax.swing.JLabel();
        labelLocacaoDataLocacaoBusca = new javax.swing.JLabel();
        txtLocacaoDataFinalLocacaoBusca = new javax.swing.JTextField();
        btnBuscarLocacao = new javax.swing.JButton();
        txtLocacaoDataInicialLocacaoBusca = new javax.swing.JTextField();
        labelDeBauca = new javax.swing.JLabel();
        labelABusca = new javax.swing.JLabel();
        painelDevolucao = new javax.swing.JPanel();
        btnDevTotComPag = new javax.swing.JButton();
        btnDevTotComPagERenov = new javax.swing.JButton();
        btnDevParcComPag = new javax.swing.JButton();
        btnDevTotComPagDepois = new javax.swing.JButton();
        btnDevParcSemPag = new javax.swing.JButton();
        txtLocacaoCodigoLocacao = new javax.swing.JTextField();
        labelLocacaoCodigo1 = new javax.swing.JLabel();
        labelLocacaoNomeCliente1 = new javax.swing.JLabel();
        comboLocacaoNomeCliente = new javax.swing.JComboBox();
        comboLocacaoTabelaLocacao = new javax.swing.JComboBox();
        labelLocacaoTabela = new javax.swing.JLabel();
        txtLocacaoDataLocacao = new javax.swing.JTextField();
        labelLocacaoDataLocacao = new javax.swing.JLabel();
        txtLocacaoDiasLocacao = new javax.swing.JTextField();
        labelLocacaoDiasLocacao = new javax.swing.JLabel();
        txtLocacaoDataPrevDevolucao = new javax.swing.JTextField();
        labelLocacaoDataPrevdevolucao = new javax.swing.JLabel();
        txtLocacaoDataDevolucao = new javax.swing.JTextField();
        labelLocacaoDataDevolucao = new javax.swing.JLabel();
        txtLocacaoVlrTotalLocacao = new javax.swing.JTextField();
        labelLocacaoVlrTotalLocacao = new javax.swing.JLabel();
        txtLocacaoEstadoLocacao = new javax.swing.JTextField();
        labelEstado = new javax.swing.JLabel();
        txtLocacaoDataRenovacao = new javax.swing.JTextField();
        labelLocacaoDatarenovacao = new javax.swing.JLabel();
        scrollTabelaItens = new javax.swing.JScrollPane();
        tabelaLocacaoItensLocacao = new javax.swing.JTable();
        jScrollPane2 = new javax.swing.JScrollPane();
        tabelaLocacao = new javax.swing.JTable();
        jTextField1 = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jTextField2 = new javax.swing.JTextField();
        jTextField3 = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jTextField4 = new javax.swing.JTextField();

        setClosable(true);
        setIconifiable(true);

        painelBuscarLocacao.setBorder(javax.swing.BorderFactory.createTitledBorder("Buscar Locação"));

        btnCancelarBuscaLocacao.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/block-icon.png"))); // NOI18N
        btnCancelarBuscaLocacao.setMnemonic('c');

        labelLocacaoCodigoBusca.setText("Cód.Locação");

        comboLocacaoNomeClienteBusca.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecione o nome" }));

        labelLocacaoNomeClienteBusca.setText("Nome Cliente");

        labelLocacaoDataLocacaoBusca.setText("Data Locação");

        btnBuscarLocacao.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/search-icon.png"))); // NOI18N
        btnBuscarLocacao.setMnemonic('s');

        labelDeBauca.setText("De");

        labelABusca.setText("a");

        javax.swing.GroupLayout painelBuscarLocacaoLayout = new javax.swing.GroupLayout(painelBuscarLocacao);
        painelBuscarLocacao.setLayout(painelBuscarLocacaoLayout);
        painelBuscarLocacaoLayout.setHorizontalGroup(
            painelBuscarLocacaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelBuscarLocacaoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(painelBuscarLocacaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(labelLocacaoCodigoBusca, javax.swing.GroupLayout.DEFAULT_SIZE, 64, Short.MAX_VALUE)
                    .addComponent(txtLocacaoCodigoLocacaoBusca))
                .addGroup(painelBuscarLocacaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelBuscarLocacaoLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnBuscarLocacao, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnCancelarBuscaLocacao, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(painelBuscarLocacaoLayout.createSequentialGroup()
                        .addGap(49, 49, 49)
                        .addGroup(painelBuscarLocacaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(labelLocacaoDataLocacaoBusca, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(painelBuscarLocacaoLayout.createSequentialGroup()
                                .addComponent(labelDeBauca, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtLocacaoDataInicialLocacaoBusca, javax.swing.GroupLayout.DEFAULT_SIZE, 96, Short.MAX_VALUE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(labelABusca, javax.swing.GroupLayout.DEFAULT_SIZE, 12, Short.MAX_VALUE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtLocacaoDataFinalLocacaoBusca, javax.swing.GroupLayout.DEFAULT_SIZE, 96, Short.MAX_VALUE))
                    .addGroup(painelBuscarLocacaoLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(painelBuscarLocacaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(labelLocacaoNomeClienteBusca)
                            .addComponent(comboLocacaoNomeClienteBusca, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addContainerGap())
        );
        painelBuscarLocacaoLayout.setVerticalGroup(
            painelBuscarLocacaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelBuscarLocacaoLayout.createSequentialGroup()
                .addGroup(painelBuscarLocacaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelLocacaoCodigoBusca)
                    .addComponent(labelLocacaoNomeClienteBusca))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(painelBuscarLocacaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(painelBuscarLocacaoLayout.createSequentialGroup()
                        .addComponent(txtLocacaoCodigoLocacaoBusca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(painelBuscarLocacaoLayout.createSequentialGroup()
                        .addComponent(comboLocacaoNomeClienteBusca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(painelBuscarLocacaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(painelBuscarLocacaoLayout.createSequentialGroup()
                                .addGap(20, 20, 20)
                                .addGroup(painelBuscarLocacaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(painelBuscarLocacaoLayout.createSequentialGroup()
                                        .addGap(6, 6, 6)
                                        .addComponent(labelABusca, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addComponent(txtLocacaoDataFinalLocacaoBusca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(painelBuscarLocacaoLayout.createSequentialGroup()
                                .addComponent(labelLocacaoDataLocacaoBusca)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(painelBuscarLocacaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(painelBuscarLocacaoLayout.createSequentialGroup()
                                        .addGap(6, 6, 6)
                                        .addComponent(labelDeBauca, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addComponent(txtLocacaoDataInicialLocacaoBusca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGap(12, 12, 12)
                        .addGroup(painelBuscarLocacaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btnCancelarBuscaLocacao, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btnBuscarLocacao, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );

        painelDevolucao.setBorder(javax.swing.BorderFactory.createTitledBorder("Devolução"));

        btnDevTotComPag.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/BaixaTotalComPagamento.png"))); // NOI18N
        btnDevTotComPag.setMnemonic('n');
        btnDevTotComPag.setToolTipText("");

        btnDevTotComPagERenov.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/BaixaTotalComPagamentoERenov.png"))); // NOI18N
        btnDevTotComPagERenov.setMnemonic('n');

        btnDevParcComPag.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/BaixaParcialComPagamento.png"))); // NOI18N
        btnDevParcComPag.setMnemonic('n');

        btnDevTotComPagDepois.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/BaixaTotalComPagamentoDepois.png"))); // NOI18N
        btnDevTotComPagDepois.setMnemonic('n');

        btnDevParcSemPag.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/BaixaParcialSemPagamento.png"))); // NOI18N
        btnDevParcSemPag.setMnemonic('n');

        labelLocacaoCodigo1.setText("Cód.Locação");

        labelLocacaoNomeCliente1.setText("Nome Cliente");

        comboLocacaoNomeCliente.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecione o nome" }));

        labelLocacaoTabela.setText("Tabela");

        labelLocacaoDataLocacao.setText("Data Locação");

        labelLocacaoDiasLocacao.setText("Dias Locação");

        labelLocacaoDataPrevdevolucao.setText("Data Prev. Devol");

        labelLocacaoDataDevolucao.setText("Data Devolução");

        labelLocacaoVlrTotalLocacao.setText("Vlr. Total");

        txtLocacaoEstadoLocacao.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        txtLocacaoEstadoLocacao.setForeground(new java.awt.Color(255, 255, 255));

        labelEstado.setText("Estado");

        labelLocacaoDatarenovacao.setText("Data Últ.  Renov.");

        javax.swing.GroupLayout painelDevolucaoLayout = new javax.swing.GroupLayout(painelDevolucao);
        painelDevolucao.setLayout(painelDevolucaoLayout);
        painelDevolucaoLayout.setHorizontalGroup(
            painelDevolucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelDevolucaoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(painelDevolucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(painelDevolucaoLayout.createSequentialGroup()
                        .addGroup(painelDevolucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(comboLocacaoTabelaLocacao, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(labelLocacaoTabela, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(painelDevolucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(labelLocacaoVlrTotalLocacao, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtLocacaoVlrTotalLocacao, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(painelDevolucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(labelEstado)
                            .addComponent(txtLocacaoEstadoLocacao, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(painelDevolucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtLocacaoDataRenovacao, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(labelLocacaoDatarenovacao))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 138, Short.MAX_VALUE))
                    .addGroup(painelDevolucaoLayout.createSequentialGroup()
                        .addGroup(painelDevolucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(painelDevolucaoLayout.createSequentialGroup()
                                .addGroup(painelDevolucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(labelLocacaoDataLocacao, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(txtLocacaoDataLocacao, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(painelDevolucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(labelLocacaoDiasLocacao, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txtLocacaoDiasLocacao, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(painelDevolucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(labelLocacaoDataPrevdevolucao, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txtLocacaoDataPrevDevolucao, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(painelDevolucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txtLocacaoDataDevolucao, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(labelLocacaoDataDevolucao)))
                            .addGroup(painelDevolucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addGroup(painelDevolucaoLayout.createSequentialGroup()
                                    .addComponent(txtLocacaoCodigoLocacao, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(comboLocacaoNomeCliente, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                .addGroup(painelDevolucaoLayout.createSequentialGroup()
                                    .addComponent(labelLocacaoCodigo1, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(labelLocacaoNomeCliente1))
                                .addGroup(painelDevolucaoLayout.createSequentialGroup()
                                    .addComponent(btnDevTotComPag, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(btnDevTotComPagERenov, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(btnDevTotComPagDepois, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(btnDevParcComPag, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(btnDevParcSemPag))))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );

        painelDevolucaoLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {btnDevParcComPag, btnDevParcSemPag, btnDevTotComPag, btnDevTotComPagDepois, btnDevTotComPagERenov});

        painelDevolucaoLayout.setVerticalGroup(
            painelDevolucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelDevolucaoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(painelDevolucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(btnDevTotComPag, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnDevParcSemPag, javax.swing.GroupLayout.DEFAULT_SIZE, 47, Short.MAX_VALUE)
                    .addComponent(btnDevTotComPagDepois, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnDevParcComPag, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnDevTotComPagERenov, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(painelDevolucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelLocacaoCodigo1)
                    .addComponent(labelLocacaoNomeCliente1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(painelDevolucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(comboLocacaoNomeCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtLocacaoCodigoLocacao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(painelDevolucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(painelDevolucaoLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addGroup(painelDevolucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(painelDevolucaoLayout.createSequentialGroup()
                                .addGroup(painelDevolucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(labelLocacaoDataLocacao)
                                    .addComponent(labelLocacaoDiasLocacao)
                                    .addComponent(labelLocacaoDataPrevdevolucao))
                                .addGap(4, 4, 4)
                                .addGroup(painelDevolucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(txtLocacaoDataLocacao)
                                    .addComponent(txtLocacaoDiasLocacao)))
                            .addGroup(painelDevolucaoLayout.createSequentialGroup()
                                .addGroup(painelDevolucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(labelLocacaoDataDevolucao)
                                    .addGroup(painelDevolucaoLayout.createSequentialGroup()
                                        .addGap(18, 18, 18)
                                        .addGroup(painelDevolucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(txtLocacaoDataPrevDevolucao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(txtLocacaoDataDevolucao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                                .addGap(0, 0, Short.MAX_VALUE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(painelDevolucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(labelEstado)
                            .addComponent(labelLocacaoVlrTotalLocacao)
                            .addComponent(labelLocacaoTabela))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(painelDevolucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtLocacaoEstadoLocacao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtLocacaoVlrTotalLocacao)
                            .addComponent(comboLocacaoTabelaLocacao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(painelDevolucaoLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(labelLocacaoDatarenovacao)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtLocacaoDataRenovacao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(51, 51, 51))
        );

        tabelaLocacaoItensLocacao.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        tabelaLocacaoItensLocacao.setSelectionForeground(new java.awt.Color(153, 0, 153));
        scrollTabelaItens.setViewportView(tabelaLocacaoItensLocacao);

        tabelaLocacao.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane2.setViewportView(tabelaLocacao);

        jTextField1.setBackground(new java.awt.Color(153, 255, 153));

        jLabel1.setText("Devol e Pag");

        jLabel2.setText("Devol e Não Pag");

        jTextField2.setBackground(new java.awt.Color(153, 204, 255));

        jTextField3.setBackground(new java.awt.Color(255, 255, 102));

        jLabel3.setText("Não Devol e  Não Pag");

        jLabel4.setText("Não Devol e  Pag");

        jTextField4.setBackground(new java.awt.Color(204, 204, 255));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(painelBuscarLocacao, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(painelDevolucao, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(scrollTabelaItens)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel2)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addComponent(jLabel1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(87, 87, 87)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel3)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel4)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(painelDevolucao, javax.swing.GroupLayout.PREFERRED_SIZE, 267, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(scrollTabelaItens, javax.swing.GroupLayout.PREFERRED_SIZE, 195, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(8, 8, 8)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel4))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel3)))
                            .addGroup(layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel1))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel2))))
                        .addContainerGap(41, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(painelBuscarLocacao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                        .addGap(23, 23, 23))))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnBuscarLocacao;
    private javax.swing.JButton btnCancelarBuscaLocacao;
    private javax.swing.JButton btnDevParcComPag;
    private javax.swing.JButton btnDevParcSemPag;
    private javax.swing.JButton btnDevTotComPag;
    private javax.swing.JButton btnDevTotComPagDepois;
    private javax.swing.JButton btnDevTotComPagERenov;
    private javax.swing.JComboBox comboLocacaoNomeCliente;
    private javax.swing.JComboBox comboLocacaoNomeClienteBusca;
    private javax.swing.JComboBox comboLocacaoTabelaLocacao;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JTextField jTextField4;
    private javax.swing.JLabel labelABusca;
    private javax.swing.JLabel labelDeBauca;
    private javax.swing.JLabel labelEstado;
    private javax.swing.JLabel labelLocacaoCodigo1;
    private javax.swing.JLabel labelLocacaoCodigoBusca;
    private javax.swing.JLabel labelLocacaoDataDevolucao;
    private javax.swing.JLabel labelLocacaoDataLocacao;
    private javax.swing.JLabel labelLocacaoDataLocacaoBusca;
    private javax.swing.JLabel labelLocacaoDataPrevdevolucao;
    private javax.swing.JLabel labelLocacaoDatarenovacao;
    private javax.swing.JLabel labelLocacaoDiasLocacao;
    private javax.swing.JLabel labelLocacaoNomeCliente1;
    private javax.swing.JLabel labelLocacaoNomeClienteBusca;
    private javax.swing.JLabel labelLocacaoTabela;
    private javax.swing.JLabel labelLocacaoVlrTotalLocacao;
    private javax.swing.JPanel painelBuscarLocacao;
    private javax.swing.JPanel painelDevolucao;
    private javax.swing.JScrollPane scrollTabelaItens;
    private javax.swing.JTable tabelaLocacao;
    private javax.swing.JTable tabelaLocacaoItensLocacao;
    private javax.swing.JTextField txtLocacaoCodigoLocacao;
    private javax.swing.JTextField txtLocacaoCodigoLocacaoBusca;
    private javax.swing.JTextField txtLocacaoDataDevolucao;
    private javax.swing.JTextField txtLocacaoDataFinalLocacaoBusca;
    private javax.swing.JTextField txtLocacaoDataInicialLocacaoBusca;
    private javax.swing.JTextField txtLocacaoDataLocacao;
    private javax.swing.JTextField txtLocacaoDataPrevDevolucao;
    private javax.swing.JTextField txtLocacaoDataRenovacao;
    private javax.swing.JTextField txtLocacaoDiasLocacao;
    private javax.swing.JTextField txtLocacaoEstadoLocacao;
    private javax.swing.JTextField txtLocacaoVlrTotalLocacao;
    // End of variables declaration//GEN-END:variables

    
    public void setCodigoDevolucao(int codigoDevolucao) {
        //txtDevolucaoCodigoDevolucaoBusca.setText(Integer.toString(codigoDevolucao));
    }

    
    public int getCodigoDevolucao() {
        return 0;//return Integer.parseInt(txtDevolucaoCodigoDevolucaoBusca.getText());
    }
    
    
    public void setCodigoLocacao(long codigoLocacao) {
        txtLocacaoCodigoLocacao.setText(Long.toString(codigoLocacao));
    }

    
    public long getCodigoLocacao() {
        return Long.parseLong(txtLocacaoCodigoLocacao.getText());
    }


    
    public void setCodigoCliente(long codigoCliente) {
        //
    }

    
    public long getCodigoCliente() {
        return 1;//Integer.parseInt(txtDevolucaoCodigoCliente.getText());
    }

    
    public void setNomeCliente(String nomeCliente) {
        comboLocacaoNomeCliente.setSelectedItem(nomeCliente);
    }

    
    public String getNomeCliente() {
        return comboLocacaoNomeCliente.getSelectedItem().toString();
    }

    
    public void setListaCliente(List<ClienteModel> listaCliente) {
        comboLocacaoNomeCliente.removeAll();
        for (int i = 0; i < listaCliente.size(); i++) // Percorro o Array List com o For aprimorado.  
        {
            this.comboLocacaoNomeCliente.addItem(listaCliente.get(i).getNome()); // Adiciono os dados.  
        }
    }

    
    public void setDataLocacao(String dataLocacao) {
        txtLocacaoDataLocacao.setText(dataLocacao);
    }

    
    public String getDataLocacao() {
        return txtLocacaoDataLocacao.getText();
    }
    
    
    public void setDataDevolucao(String dataDevolucao) {
        txtLocacaoDataDevolucao.setText(dataDevolucao);
    }
    
    public String getDataDevolucao() {
        return txtLocacaoDataDevolucao.getText();
    }
    
    public void setDataRenovacao(String dataRenovacao) {
        txtLocacaoDataRenovacao.setText(dataRenovacao);
    }
    
    public String getDataRenovacao() {
        return txtLocacaoDataRenovacao.getText();
    }

    
    public void setDataPrevDevolucao(String dataPrevDevolucao) {
        txtLocacaoDataPrevDevolucao.setText(dataPrevDevolucao);
    }

    
    public String getDataPrevDevolucao() {
        return txtLocacaoDataPrevDevolucao.getText();
    }

    
    public void setTabelaPreco(String tabelaPreco) {
        comboLocacaoTabelaLocacao.setSelectedItem(tabelaPreco);
    }

    
    public String getTabelaPreco() {
        return comboLocacaoTabelaLocacao.getSelectedItem().toString();
    }

    
    public void setDiasLocacao(int diasDevolucao) {
        txtLocacaoDiasLocacao.setText(Integer.toString(diasDevolucao));
    }

    
    public int getDiasLocacao() {
        return Integer.parseInt(txtLocacaoDiasLocacao.getText());
    }

    
    public void packAndShow() {
        ConfiguracaoInstancias.getDesktop().getDesktop().add(this);
        comboLocacaoTabelaLocacao.setEditable(false);
        this.pack();
        this.setVisible(true);
    }

    
    public void clearFields() {
        //throw new UnsupportedOperationException("Not supported yet.");
    }

    
    public void enableTxtCodigoLocacao(boolean arg) {
        txtLocacaoCodigoLocacao.setEnabled(arg);
    }

    
    public void enableTxtCodigoCliente(boolean arg) {
        //txtLocacaoCodigoCliente.setEnabled(arg);
    }

    
    public void enableComboNomeCliente(boolean arg) {
        comboLocacaoNomeCliente.setEnabled(arg);
    }

    
    public void enableTxtDataDevolucao(boolean arg) {
        txtLocacaoDataDevolucao.setEnabled(arg);
    }
    
    
    public void enableTxtDataLocacao(boolean arg) {
        txtLocacaoDataLocacao.setEnabled(arg);
    }

    
    public void enableTxtDataPrevDevolucao(boolean arg) {
        txtLocacaoDataPrevDevolucao.setEnabled(arg);
    }

    
    public void enableComboTabelaPreco(boolean arg) {
        comboLocacaoTabelaLocacao.setEnabled(arg);
    }

    
    public void enableTxtDiasLocacao(boolean arg) {
        txtLocacaoDiasLocacao.setEnabled(arg);
    }
    
    
    public void enableBtnBuscar(boolean arg) {
        btnBuscarLocacao.setEnabled(arg);
    }

    
    public void enableBtnCancelarBusca(boolean arg) {
        btnCancelarBuscaLocacao.setEnabled(arg);
    }

    
    public void enableBtnDevTotComPag(boolean arg) {
        btnDevTotComPag.setEnabled(arg);
    }

    
    public void enableBtnDevTotComPagERenov(boolean arg) {
        btnDevTotComPagERenov.setEnabled(arg);
    }

    
    public void enableBtnDevTotComPagDepois(boolean arg) {
        btnDevTotComPagDepois.setEnabled(arg);
    }

    
    public void enableBtnDevParcComPag(boolean arg) {
        btnDevParcComPag.setEnabled(arg);
    }

    
    public void enableBtnDevParcSemPag(boolean arg) {
        btnDevParcSemPag.setEnabled(arg);        
    }
        
    public void setEstadoBackgroundColor(Color color) {
        txtLocacaoEstadoLocacao.setBackground(color);
    }

    
    public void removeAllitensComboCliente() {
        //throw new UnsupportedOperationException("Not supported yet.");
    }
   
    
    public void setItensLocacaoTableModel(ItensLocacaoTableModel itensLocacaoTableModel) {
        this.tabelaLocacaoItensLocacao.setModel(itensLocacaoTableModel);
        
        // Configura as colunas da JTable  
        TableColumnModel columnModel = this.tabelaLocacaoItensLocacao.getColumnModel();

        columnModel.getColumn(0).setHeaderValue("Cód.");
        columnModel.getColumn(0).setPreferredWidth(20);

        columnModel.getColumn(1).setHeaderValue("Série");
        columnModel.getColumn(1).setPreferredWidth(40);

        columnModel.getColumn(2).setHeaderValue("Descrição");
        columnModel.getColumn(2).setPreferredWidth(140);

        columnModel.getColumn(3).setHeaderValue("Vlr Prod.");
        columnModel.getColumn(3).setPreferredWidth(20);

        columnModel.getColumn(4).setHeaderValue("Vlr Item.");
        columnModel.getColumn(4).setPreferredWidth(20);
        
        columnModel.getColumn(5).setHeaderValue("Qtd.");
        columnModel.getColumn(5).setPreferredWidth(20);
        
        columnModel.getColumn(6).setHeaderValue("UN");
        columnModel.getColumn(6).setPreferredWidth(15);
        
        columnModel.getColumn(7).setHeaderValue("Status");
        columnModel.getColumn(7).setPreferredWidth(15);
        
        columnModel.getColumn(8).setHeaderValue("Pgto");
        columnModel.getColumn(8).setPreferredWidth(15);
        
        columnModel.getColumn(9).setHeaderValue("Dt. Devol");
        columnModel.getColumn(9).setPreferredWidth(40);

    }
    
    public void setTableRender(DefaultTableCellRenderer dtcr) {        
        tabelaLocacaoItensLocacao.setDefaultRenderer(Object.class, dtcr);
    }
    
    public void setLocacaoTableModel(LocacaoTableModel locacaoTableModel) {
        this.tabelaLocacao.setModel(locacaoTableModel);
        
        // Configura as colunas da JTable  
        TableColumnModel columnModel = this.tabelaLocacao.getColumnModel();

        columnModel.getColumn(0).setHeaderValue("Cód.Loc.");
        columnModel.getColumn(0).setPreferredWidth(20);

        columnModel.getColumn(1).setHeaderValue("Nome Cliente");
        columnModel.getColumn(1).setPreferredWidth(30);

        columnModel.getColumn(2).setHeaderValue("Data Loc.");
        columnModel.getColumn(2).setPreferredWidth(100);

        columnModel.getColumn(3).setHeaderValue("Status Loc");
        columnModel.getColumn(3).setPreferredWidth(30);

    }

    
    public ItensLocacaoTableModel getitensLocacaoTableModel() {
        return (ItensLocacaoTableModel) this.tabelaLocacaoItensLocacao.getModel();//throw new UnsupportedOperationException("Not supported yet.");
    }
    
    
    public int[] linhasSelecionadasTableItens() {
        return this.tabelaLocacaoItensLocacao.getSelectedRows();
    }

    
    public void refreshTableItensLocacao() {
        this.tabelaLocacaoItensLocacao.updateUI();
    }
    
    
    public LocacaoTableModel getLocacaoTableModel() {
        return (LocacaoTableModel) this.tabelaLocacao.getModel();//throw new UnsupportedOperationException("Not supported yet.");
    }

    
    public void refreshTableLocacao() {
        this.tabelaLocacao.updateUI();
    }

    
    public void setDevTotComPagActionListener(ActionListener listener) {
        this.btnDevTotComPag.addActionListener(listener);
    }

    
    public void setDevTotComPagERenovActionListener(ActionListener listener) {
        this.btnDevTotComPagERenov.addActionListener(listener);
    }

    
    public void setDevTotComPagDepoisActionListener(ActionListener listener) {
        this.btnDevTotComPagDepois.addActionListener(listener);
    }

    
    public void setDevParcComPagActionListener(ActionListener listener) {
        this.btnDevParcComPag.addActionListener(listener);
    }

    
    public void setDevParcSemPagActionListener(ActionListener listener) {
        this.btnDevParcSemPag.addActionListener(listener);
    }    
    
    
    public void setBuscarLocacaoActionListener(ActionListener listener) {
        this.btnBuscarLocacao.addActionListener(listener);
    }

    
    public void setCancelarBuscaActionListener(ActionListener listener) {
        this.btnCancelarBuscaLocacao.addActionListener(listener);
    }

    
    public void setListaTabelaPreco(List<String> tabelaPreco) {
        for (int i = 0; i < tabelaPreco.size(); i++) // Percorro o Array List com o For aprimorado.  
        {
            this.comboLocacaoTabelaLocacao.addItem(tabelaPreco.get(i)); // Adiciono os dados.  
        }
    }

    
    public void setMascaraListener(KeyListener listener) {
        this.txtLocacaoDataInicialLocacaoBusca.addKeyListener(listener);
        this.txtLocacaoDataFinalLocacaoBusca.addKeyListener(listener);
        this.txtLocacaoDataLocacao.addKeyListener(listener);
        this.txtLocacaoDataDevolucao.addKeyListener(listener);
        this.txtLocacaoDataPrevDevolucao.addKeyListener(listener);
    }

    
    public void removeAllitensComboNomeCliente() {
        this.comboLocacaoNomeCliente.removeAllItems();
    }

    
    public void removeAllitensComboTabelaPreco() {
        this.comboLocacaoTabelaLocacao.removeAllItems();
    }

    
    public void clearFieldsPainelBuscarLocacao() {
        Component[] componentesPainel;
        componentesPainel = painelBuscarLocacao.getComponents();
        for (int j = 0; j < componentesPainel.length; j++) {
            if (componentesPainel[j] instanceof JTextField) {
                JTextField field = (JTextField) componentesPainel[j];
                field.setText("");
            }
        }
    }

    
    public void clearFieldsPainelDevolucao() {
        Component[] componentesPainel;
        componentesPainel = painelDevolucao.getComponents();
        for (int j = 0; j < componentesPainel.length; j++) {
            if (componentesPainel[j] instanceof JTextField) {
                JTextField field = (JTextField) componentesPainel[j];
                field.setText("");
            }
        }
    }
    
  
    
    public int linhaSelecionadaTableItens() {
        return this.tabelaLocacaoItensLocacao.getSelectedRow();      
    }
    
     
    public int linhaSelecionadaTableLocacao() {
        return this.tabelaLocacao.getSelectedRow();      
    }

    
    public void setTableItensLocacaoMouseListener(MouseListener listener) {
        this.tabelaLocacaoItensLocacao.addMouseListener(listener);
    }
    
    
    public void setTableLocacaoMouseListener(MouseListener listener) {
        this.tabelaLocacao.addMouseListener(listener);
    }
    
    public void setStatusLocacao(String statusLocacao) {
        this.txtLocacaoEstadoLocacao.setText(statusLocacao);
    }

    
    public String getStatusLocacao() {
        return this.txtLocacaoEstadoLocacao.getText();
    }

    
    public void setCodigoLocacaoBusca(int codigoLocacaoBusca) {
        txtLocacaoCodigoLocacaoBusca.setText(Integer.toString(codigoLocacaoBusca));
    }

    
    public String getCodigoLocacaoBusca() {
        return txtLocacaoCodigoLocacaoBusca.getText().equals("")?"0":(txtLocacaoCodigoLocacaoBusca.getText());
    }

    
    public void setDataInicialBusca(String dataInicialBusca) {
        txtLocacaoDataInicialLocacaoBusca.setText(dataInicialBusca);
    }

    
    public String getDataInicialBusca() {
        return txtLocacaoDataInicialLocacaoBusca.getText().equals("")?"0":(txtLocacaoDataInicialLocacaoBusca.getText());
    }

    
    public void setDataFinalBusca(String dataFinalBusca) {
        txtLocacaoDataFinalLocacaoBusca.setText(dataFinalBusca);
    }

    
    public String getDataFinalBusca() {
        return txtLocacaoDataFinalLocacaoBusca.getText().equals("")?"0":(txtLocacaoDataFinalLocacaoBusca.getText());
    }

    
    public void setNomeClienteBusca(String nomeClienteBusca) {
        comboLocacaoNomeClienteBusca.setSelectedItem(nomeClienteBusca);
    }

    
    public String getNomeClienteBusca() {
        return comboLocacaoNomeClienteBusca.getSelectedItem().toString();
    }

    
    public void setListaClienteBusca(List<ClienteModel> listaClienteBusca) {
        comboLocacaoNomeClienteBusca.removeAll();
        for (int i = 0; i < listaClienteBusca.size(); i++) // Percorro o Array List com o For aprimorado.  
        {
            this.comboLocacaoNomeClienteBusca.addItem(listaClienteBusca.get(i).getNome()); // Adiciono os dados.  
        }
    }

    
    public void setValorTotalLocacao(double valorTotalLocacao) {
        this.txtLocacaoVlrTotalLocacao.setText(Double.toString(valorTotalLocacao));
    }

    
    public double getValorTotalLocacao() {
        return Double.parseDouble(txtLocacaoVlrTotalLocacao.getText());
    }

}
